% A demo for takato's programming result
% Plotting Illustration only
% clear;close all;clc
theta0 = 0; 
D = 1.637; % Diameter[m]
R = D/2;
L = 20e3; %湍流路径的长度[m]
s = linspace(0,6,300);
lenbda = 555e-9; % wavelength [m]
% references in Anzuola and Gladysz [2017]
Cn2 = H_V_Cn2(2.7,1.7e-14,21/27);


t1 = cputime;
L0_1 = D*inf;
L0_2 = 1*D;
L0_3 = 10*D;
L0_4 = 20*D;
L0_5 = 50*D;
L0_6 = inf*D; 
k0 = [1/L0_1,1/L0_2,1/L0_3,1/L0_4,1/L0_5,1/L0_6];

s_lent = length(s);
E_ajsM = zeros(6,s_lent);
for i = 1:6
    E_ajsM(i,:) = takato_spatial_correlated(2,2,s,theta0,D,k0(i),lenbda,Cn2,L);
end

figure
for j = 1:6
    plot(s,E_ajsM(j,:)/E_ajsM(j,1),'r-');
    hold on
end
grid on
xlabel('aperture separation s[1/D]')
ylabel('C_{44}(s)')
%ylim([0,1])
t2 = cputime - t1